<form id='newsform' action="{:U('News:///News/changeCategory')}"  method="post" class="ajax-form">
<div class="container">
    <div class="row">
    <div class="col-xs-3">
        <h3>选择分类:</h3>
        <select name="cid">
            <volist name="cat" id="c">
                <option  value="{$c.id}">{$c.title}</option>
            </volist>
        </select>
    </div>
    <div class="col-xs-9">
        <input type="hidden" value="{$ids}" name="ids">
        <h3>资讯迁移名单:</h3>
        <table style="width: 100%">
            <th>ID</th><th>标题</th>
            <volist name="data" id="d">
            <tr>
                <td>{$d.id}</td>
                <td>{$d.title}</td>
            </tr>
            </volist>
        </table>
    </div>
        </div>
</div>
    <div style="text-align: center;margin-top: 30px">
        <a class="btn btn-primary" data-role="submit" style="margin-right: 30px">迁移</a>
        <a onclick="$('.close').click();" class="btn btn-default">返回</a>
    </div>
</form>
<script>
    $(function(){
        $('[data-role="submit"]').click(function(){
            query=$('#newsform').serialize();
            var url=$('#newsform').attr('action');
            $.post(url,query,function(msg){
               if(msg==1){
                   toast.success('迁移成功');
                   window.location.reload();
               }else{
                   toast.error('迁移失败');
               }
            },'json');
        });
    });
</script>